﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrdersHtmlContent.ascx.cs" Inherits="Shop.Web.Controls.Ajax.OrdersHtmlContent" %>
<asp:Repeater runat="server" ID="rprOrders" OnItemDataBound="rprOrders_OnItemDataBound">
<HeaderTemplate><table style="width:100%"></HeaderTemplate>
<ItemTemplate>
<tr>
<td>
    <span class="showhide" hide="true" detail="#order_<%# DataBinder.Eval(Container, "DataItem.Id")%>">Заказ №<%# DataBinder.Eval(Container, "DataItem.Id")%></span> на сумму <%# DataBinder.Eval(Container.DataItem, "Total", "{0:0,0}")%>р., доставка: <%# DataBinder.Eval(Container.DataItem, "DeliveryDate", "{0:d MMMM, dddd}")%>, получатель: <%# DataBinder.Eval(Container.DataItem, "CreatedBy.FullName")%>&nbsp;
</td>
<td>
    <input id="btnDelOrder" type="button" class="del" value="x"  runat="server"/>
    <div class="fright ui-state-default ui-corner-all" title="Доставлено" runat="server" ID="btnDelivered" >
        <span class="ui-icon ui-icon-circle-check"/>
    </div>
</td>
</tr>
<tr><td colspan="2">
<div id="order_<%# DataBinder.Eval(Container, "DataItem.Id")%>">
<asp:Repeater DataSource='<%# DataBinder.Eval(Container.DataItem, "Items")%>' runat="server" ID="rprOrderItems" OnItemDataBound="OnItemDataBound">
        <ItemTemplate>
            - <input type="checkbox" runat="server" id="chbSetDelivered" checked="checked" visible="false"/><a href='Product.aspx?id=<%# DataBinder.Eval(Container, "DataItem.Product.Group.Id")%>'><%# DataBinder.Eval(Container, "DataItem.Product.BrandArt")%>: <%# DataBinder.Eval(Container, "DataItem.Product.Name")%></a>, цена: <%# DataBinder.Eval(Container, "DataItem.Product.Price", "{0:C}")%>&nbsp;<input id="btnDelItem" type="button" class="del" value="x"  runat="server"/><br />
        </ItemTemplate>
    </asp:Repeater>
</div>
</td></tr>
</ItemTemplate>
<FooterTemplate></table></FooterTemplate>
</asp:Repeater>
<script type="text/javascript">
function SetOrderDelivered(id) {
    $.post("AjaxHtmlContent.aspx?Content=SetOrderDelivered",
                   { id: id
                   },
                   function(data) {
                       $('#tabs_sub_menu').tabs('select', 2);
                   }
                   );
               }
               
</script>
